//
//  UsersModel.m
//  NetworkingSevers
//
//  Created by Samuel on 14-4-22.
//
//

#import "UsersModel.h"

@implementation UsersModel
+ (UsersModel*)getDictionaryToObject:(NSDictionary*)dictionary
{
    UsersModel *model = [[UsersModel alloc]init];
    
    model.isId         = [dictionary objectForKey:@"id"];
    model.username     = [dictionary objectForKey:@"username"];
    model.nicename     = [dictionary objectForKey:@"nicename"];
    model.email        = [dictionary objectForKey:@"email"];
    model.url          = [dictionary objectForKey:@"url"];
    model.registered   = [dictionary objectForKey:@"registered"];
    model.displayname  = [dictionary objectForKey:@"displayname"];
    model.firstname    = [dictionary objectForKey:@"firstname"];
    model.lastname     = [dictionary objectForKey:@"lastname"];
    model.nickname     = [dictionary objectForKey:@"nickname"];
    model.description  = [dictionary objectForKey:@"description"];
    model.capabilities = [dictionary objectForKey:@"capabilities"];
    
    return model;
}
+ (NSMutableDictionary*)getObjectToDictionary:(UsersModel*)model
{
    NSMutableDictionary *dictionary = [[NSMutableDictionary alloc]init];
    
    [dictionary setObject:model.isId forKey:@"id"];
    [dictionary setObject:model.username forKey:@"username"];
    [dictionary setObject:model.nicename forKey:@"nicename"];
    [dictionary setObject:model.email forKey:@"email"];
    [dictionary setObject:model.url forKey:@"url"];
    [dictionary setObject:model.registered forKey:@"registered"];
    [dictionary setObject:model.displayname forKey:@"displayname"];
    [dictionary setObject:model.firstname forKey:@"firstname"];
    [dictionary setObject:model.lastname forKey:@"lastname"];
    [dictionary setObject:model.nickname forKey:@"nickname"];
    [dictionary setObject:model.description forKey:@"description"];
    [dictionary setObject:model.capabilities forKey:@"capabilities"];
    
    return dictionary;
}
@end
